Hi All,
I am implementing a streaming notification technique in Email client application. For Inbox folder any new email arrives it is raising the event. But for Sent Items folder notification event not firing.
Below is the code snippet.
For Inbox:
StreamingSubscription streamingSubscription = service.SubscribeToStreamingNotifications(new FolderId[] { WellKnownFolderName.Inbox },EventType.NewMail);
connection.AddSubscription(streamingSubscription);connection.OnNotificationEvent += connection_OnNotificationEvent;
connection.OnDisconnect += connection_OnDisconnect;
connection.Open();
void connection_OnNotificationEvent(object sender, NotificationEventArgs args)
{
where e.EventType == EventType.NewMail || e.EventType== EventType.Created
select e.ItemId;
}
For Sent Items:
treamingSubscription streamingSubscription = service.SubscribeToStreamingNotifications(new FolderId[] { WellKnownFolderName.SentItems},EventType.Created);
connection.AddSubscription(streamingSubscription);connection.OnNotificationEvent += connection_OnNotificationEvent;
connection.OnDisconnect += connection_OnDisconnect;
connection.Open();
void connection_OnNotificationEvent(object sender, NotificationEventArgs args)
{
where e.EventType == EventType.NewMail || e.EventType== EventType.Created
select e.ItemId;
}
Thanks
Naresh